package BookStore.view;


import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


public class RegisterFrame extends JFrame {
    private JPanel contentPane;

    public void result_1(){
        EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                try {
                    RegisterFrame frame = new RegisterFrame();
                    frame.setVisible(true);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }

    public RegisterFrame() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setBounds(500, 250, 450, 300);
        contentPane = new JPanel();
        contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
        setContentPane(contentPane);
        contentPane.setLayout(null);

        JLabel label_1 = new JLabel("请选择注册类型");
        label_1.setFont(new Font("Lucida Grande", Font.PLAIN, 20));
        label_1.setForeground(Color.RED);
        label_1.setBounds(151, 49, 140, 36);
        contentPane.add(label_1);

        JButton button_3 = new JButton("注册新用户");
        button_3.setBounds(91, 192, 99, 29);
        contentPane.add(button_3);

        JButton button_4 = new JButton("注册管理员");
        button_4.setBounds(249, 192, 99, 29);
        contentPane.add(button_4);

        button_3.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                setVisible(false);
                new Uregister().result_2();
            }
        });

        button_4.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                setVisible(false);
                new Aregister().result_3();
            }
        });

    }
}
